//
//  JKDPickerViewUtilis.m
//  JunKeDai
//
//  Created by 刘广 on 2018/2/8.
//  Copyright © 2018年 DD. All rights reserved.
//

#import "LLPickerViewUtilis.h"

@interface LLPickerViewUtilis ()

@end

@implementation LLPickerViewUtilis

+ (void)createPickerSingleWithArrayData:(NSArray<NSString *> *)arrayData delegate:(id<STPickerSingleDelegate>)delegate
{
    STPickerSingle *_pickerSingle = [[STPickerSingle alloc] init];
    _pickerSingle.delegate = delegate;
    _pickerSingle.arrayData = arrayData.mutableCopy;
    _pickerSingle.widthPickerComponent = SCREEN_WIDTH - 30;
    _pickerSingle.contentMode = STPickerContentModeBottom;
    [_pickerSingle show];
}

+ (void)createPickerAreaWithDelegate:(id<STPickerAreaDelegate>)delegate
{
    STPickerArea *pickerArea = [[STPickerArea alloc]init];
    [pickerArea setDelegate:delegate];
    [pickerArea setSaveHistory:YES];
    [pickerArea setContentMode:STPickerContentModeBottom];
    [pickerArea show];
}



//+ (void)createPickDateWithDelegate:(id<STPickerDateDelegate>)delegate
//{
//    STPickerDate *date = [[STPickerDate alloc] init];
//    date.delegate = delegate;
//    date.contentMode = STPickerContentModeBottom;
//    date.yearLeast = 1980;
//    date.yearSum = 100;
//    [date show];
//}


//+ (void)createLimitYearPickDateWithDelegate:(id<STPickerDateDelegate>)delegate
//{
//    NSDate *currentDate = [NSDate dateWithTimeIntervalSinceNow:3600 * 8];
//    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
//    [formatter setDateFormat:@"yyyy"];
//    [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:8]]; //指定东八区
//    NSString *dateString = [formatter stringFromDate:currentDate];
//    
//    STPickerDate *date = [[STPickerDate alloc] init];
//    date.delegate = delegate;
//    date.contentMode = STPickerContentModeBottom;
//    date.yearSum = 3;
//    date.yearLeast = [dateString integerValue] - date.yearSum + 1;
//    [date show];
//
//}
//
//
//+ (void)createLimitYearPickThreeDateWithDelegate:(id<STPickerThreeDateDelegate>)delegate
//{
//    // 系统时间
////    NSDate *currentDate = [NSDate dateWithTimeIntervalSinceNow:3600 * 8];
//    // 服务器时间
//    NSDate *currentDate = [[LLTimeHandle sharedTimeHandle] getCurrentServerTimeDate];
//    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
//    [formatter setDateFormat:@"yyyy"];
//    [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:8]]; //指定东八区
//    NSString *dateString = [formatter stringFromDate:currentDate];
//    
//    STPickerThreeDate *date = [[STPickerThreeDate alloc] init];
//    date.delegate = delegate;
//    date.contentMode = STPickerContentModeBottom;
//    date.yearSum = 10;
//    date.yearLeast = [dateString integerValue] - date.yearSum + 10;
//    [date show];
//    
//}
//
//
//
///**
// 从今天起往前几年的日期
// @param years 前几年
// */
//+ (void)createLastLimitYearPickThreeDateWithDelegate:(id<STPickerThreeDateDelegate>)delegate years:(NSInteger)years
//{
//    NSDate *currentDate = [[LLTimeHandle sharedTimeHandle] getCurrentServerTimeDate];
//    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
//    [formatter setDateFormat:@"yyyy"];
//    [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:8]]; //指定东八区
//    NSString *dateString = [formatter stringFromDate:currentDate];
//    
//    STPickerThreeDate *date = [[STPickerThreeDate alloc] init];
//    date.delegate = delegate;
//    date.contentMode = STPickerContentModeBottom;
//    date.yearSum = years;
//    date.yearLeast = [dateString integerValue] - years + 1;
//    [date show];
//}

/**
 年月日
 */
//+ (void)createYearPickThreeDateWithDelegate:(id<STPickerThreeDateDelegate>)delegate
//{
//    STPickerThreeDate *date = [[STPickerThreeDate alloc] init];
//    date.delegate = delegate;
//    date.contentMode = STPickerContentModeBottom;
//    date.yearLeast = 2000;
//    date.yearSum = 30;
//    [date show];
//}


@end
